.class public Lcom/teewoo/app/bus/BeforeLogin;
.super Landroid/app/Activity;
.source "BeforeLogin.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/teewoo/app/bus/BeforeLogin$EndTask;
    }
.end annotation


# static fields
.field public static final E_STATION_MODE:Ljava/lang/String; = "e_station_mode"

.field public static final E_STATION_MODE_NAME:Ljava/lang/String; = "e_station_mode_name"

.field public static final E_STATION_STYLE:Ljava/lang/String; = "e_station_style"

.field public static final E_STATION_STYLE_NAME:Ljava/lang/String; = "e_station_style_name"

.field public static final LAST_LOCATION_LAT:Ljava/lang/String; = "last_location_latitude"

.field public static final LAST_LOCATION_LON:Ljava/lang/String; = "last_location_longitude"

.field public static final LAST_START_TIME:Ljava/lang/String; = "last_start_time"

.field public static final SHAREDPREFERENCES_CITY:Ljava/lang/String; = "my_city"

.field public static final SHAREDPREFERENCES_NAME:Ljava/lang/String; = "mypreferences"

.field public static final SHAREDPREFERENCES_SHORTCUT:Ljava/lang/String; = "hasShortCut"

.field public static lastStartTime:Ljava/lang/String;

.field public static preference:Landroid/content/SharedPreferences;


# instance fields
.field private cTask:Lcom/teewoo/app/bus/BeforeLogin$EndTask;

.field private timer:Ljava/util/Timer;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 47
    const/4 v0, 0x0

    sput-object v0, Lcom/teewoo/app/bus/BeforeLogin;->lastStartTime:Ljava/lang/String;

    .line 25
    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 25
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    return-void
.end method

.method static synthetic access$0(Lcom/teewoo/app/bus/BeforeLogin;)V
    .locals 0
    .parameter

    .prologue
    .line 69
    invoke-direct {p0}, Lcom/teewoo/app/bus/BeforeLogin;->doTimer()V

    return-void
.end method

.method private addShortcut()V
    .locals 6

    .prologue
    .line 110
    new-instance v2, Landroid/content/Intent;

    const-string v3, "com.android.launcher.action.INSTALL_SHORTCUT"

    invoke-direct {v2, v3}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 112
    .local v2, shortcut:Landroid/content/Intent;
    const-string v3, "android.intent.extra.shortcut.NAME"

    const v4, 0x7f080001

    invoke-virtual {p0, v4}, Lcom/teewoo/app/bus/BeforeLogin;->getString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 113
    const-string v3, "duplicate"

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 116
    new-instance v0, Landroid/content/ComponentName;

    invoke-virtual {p0}, Lcom/teewoo/app/bus/BeforeLogin;->getPackageName()Ljava/lang/String;

    move-result-object v3

    new-instance v4, Ljava/lang/StringBuilder;

    const-string v5, "."

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0}, Lcom/teewoo/app/bus/BeforeLogin;->getLocalClassName()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-direct {v0, v3, v4}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 117
    .local v0, comp:Landroid/content/ComponentName;
    const-string v3, "android.intent.extra.shortcut.INTENT"

    new-instance v4, Landroid/content/Intent;

    const-string v5, "android.intent.action.MAIN"

    invoke-direct {v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {v4, v0}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    .line 119
    const v3, 0x7f020020

    invoke-static {p0, v3}, Landroid/content/Intent$ShortcutIconResource;->fromContext(Landroid/content/Context;I)Landroid/content/Intent$ShortcutIconResource;

    move-result-object v1

    .line 120
    .local v1, iconRes:Landroid/content/Intent$ShortcutIconResource;
    const-string v3, "android.intent.extra.shortcut.ICON_RESOURCE"

    invoke-virtual {v2, v3, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    .line 122
    invoke-virtual {p0, v2}, Lcom/teewoo/app/bus/BeforeLogin;->sendBroadcast(Landroid/content/Intent;)V

    .line 123
    return-void
.end method

.method private doTimer()V
    .locals 4

    .prologue
    .line 70
    new-instance v0, Lcom/teewoo/app/bus/BeforeLogin$EndTask;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Lcom/teewoo/app/bus/BeforeLogin$EndTask;-><init>(Lcom/teewoo/app/bus/BeforeLogin;Lcom/teewoo/app/bus/BeforeLogin$EndTask;)V

    iput-object v0, p0, Lcom/teewoo/app/bus/BeforeLogin;->cTask:Lcom/teewoo/app/bus/BeforeLogin$EndTask;

    .line 71
    new-instance v0, Ljava/util/Timer;

    invoke-direct {v0}, Ljava/util/Timer;-><init>()V

    iput-object v0, p0, Lcom/teewoo/app/bus/BeforeLogin;->timer:Ljava/util/Timer;

    .line 72
    iget-object v0, p0, Lcom/teewoo/app/bus/BeforeLogin;->timer:Ljava/util/Timer;

    iget-object v1, p0, Lcom/teewoo/app/bus/BeforeLogin;->cTask:Lcom/teewoo/app/bus/BeforeLogin$EndTask;

    const-wide/16 v2, 0x7d0

    invoke-virtual {v0, v1, v2, v3}, Ljava/util/Timer;->schedule(Ljava/util/TimerTask;J)V

    .line 73
    return-void
.end method


# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
    .locals 7
    .parameter "savedInstanceState"

    .prologue
    const/16 v3, 0x400

    const/4 v6, 0x1

    const/4 v5, 0x0

    .line 49
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 50
    invoke-virtual {p0, v6}, Lcom/teewoo/app/bus/BeforeLogin;->requestWindowFeature(I)Z

    .line 51
    invoke-virtual {p0}, Lcom/teewoo/app/bus/BeforeLogin;->getWindow()Landroid/view/Window;

    move-result-object v2

    invoke-virtual {v2, v3, v3}, Landroid/view/Window;->setFlags(II)V

    .line 52
    const/high16 v2, 0x7f03

    invoke-virtual {p0, v2}, Lcom/teewoo/app/bus/BeforeLogin;->setContentView(I)V

    .line 54
    const-string v2, "mypreferences"

    invoke-virtual {p0, v2, v5}, Lcom/teewoo/app/bus/BeforeLogin;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v2

    sput-object v2, Lcom/teewoo/app/bus/BeforeLogin;->preference:Landroid/content/SharedPreferences;

    .line 56
    sget-object v2, Lcom/teewoo/app/bus/BeforeLogin;->preference:Landroid/content/SharedPreferences;

    const-string v3, "last_start_time"

    invoke-static {}, Lcom/teewoo/app/bus/util/Utils;->getLocFullTime()Ljava/lang/String;

    move-result-object v4

    invoke-interface {v2, v3, v4}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    sput-object v2, Lcom/teewoo/app/bus/BeforeLogin;->lastStartTime:Ljava/lang/String;

    .line 58
    sget-object v2, Lcom/teewoo/app/bus/BeforeLogin;->preference:Landroid/content/SharedPreferences;

    invoke-interface {v2}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    .line 59
    .local v0, editor:Landroid/content/SharedPreferences$Editor;
    const-string v2, "last_start_time"

    invoke-static {}, Lcom/teewoo/app/bus/util/Utils;->getLocFullTime()Ljava/lang/String;

    move-result-object v3

    invoke-interface {v0, v2, v3}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 60
    sget-object v2, Lcom/teewoo/app/bus/BeforeLogin;->preference:Landroid/content/SharedPreferences;

    const-string v3, "hasShortCut"

    invoke-interface {v2, v3, v5}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v1

    .line 61
    .local v1, hasShortCut:Z
    if-nez v1, :cond_0

    .line 63
    invoke-direct {p0}, Lcom/teewoo/app/bus/BeforeLogin;->addShortcut()V

    .line 64
    const-string v2, "hasShortCut"

    invoke-interface {v0, v2, v6}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;

    .line 66
    :cond_0
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 67
    return-void
.end method

.method public onStart()V
    .locals 1

    .prologue
    .line 85
    invoke-super {p0}, Landroid/app/Activity;->onStart()V

    .line 86
    new-instance v0, Lcom/teewoo/app/bus/BeforeLogin$1;

    invoke-direct {v0, p0}, Lcom/teewoo/app/bus/BeforeLogin$1;-><init>(Lcom/teewoo/app/bus/BeforeLogin;)V

    .line 90
    invoke-virtual {v0}, Lcom/teewoo/app/bus/BeforeLogin$1;->start()V

    .line 91
    return-void
.end method

.method public onStop()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 95
    invoke-super {p0}, Landroid/app/Activity;->onStop()V

    .line 96
    iget-object v0, p0, Lcom/teewoo/app/bus/BeforeLogin;->cTask:Lcom/teewoo/app/bus/BeforeLogin$EndTask;

    if-eqz v0, :cond_0

    .line 97
    iget-object v0, p0, Lcom/teewoo/app/bus/BeforeLogin;->cTask:Lcom/teewoo/app/bus/BeforeLogin$EndTask;

    invoke-virtual {v0}, Lcom/teewoo/app/bus/BeforeLogin$EndTask;->cancel()Z

    .line 99
    :cond_0
    iput-object v1, p0, Lcom/teewoo/app/bus/BeforeLogin;->cTask:Lcom/teewoo/app/bus/BeforeLogin$EndTask;

    .line 100
    iget-object v0, p0, Lcom/teewoo/app/bus/BeforeLogin;->timer:Ljava/util/Timer;

    if-eqz v0, :cond_1

    .line 101
    iget-object v0, p0, Lcom/teewoo/app/bus/BeforeLogin;->timer:Ljava/util/Timer;

    invoke-virtual {v0}, Ljava/util/Timer;->cancel()V

    .line 103
    :cond_1
    iput-object v1, p0, Lcom/teewoo/app/bus/BeforeLogin;->timer:Ljava/util/Timer;

    .line 105
    return-void
.end method
